package com.fly.office.constant;

/**
 * 图表定义
 * @author lf
 */
public enum ChartEnum {

    CHART_COLUMNAR(1,"柱状图"),
    CHART_LINE(2,"折线图"),
    CHART_PIE(3,"饼状图"),
    CHART_BAR(4,"条形图"),
    CHART_RADAR(5,"雷达图"),
    CHART_UNKNOWN(9,"图表类型未定义");

    private int code;

    private String desc;

    ChartEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String desc(int code) {
        for (ChartEnum m : ChartEnum.values()) {
            if (m.getCode() == code) {
                return m.getDesc();
            }
        }
        return CHART_UNKNOWN.getDesc();
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
